<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <?php
            $parent = NULL;
            function get_list($parent) {
            $children = query('SELECT * FROM actividad WHERE id_padre = '.$parent);
            $items = array();
            while($row = fetch_assoc($children)) {
                $items[] = '<li>'.$row['name'].get_list($row['id_actividad']).'</li>';
            }
            if(count($items)) {
                return '<ul>'.implode('', $items).'</ul>';
            } else {
                return '';
            }
            get_list($parent);
        }
        ?>
    </body>
</html>
